from pathlib import Path

from devtools import debug
from pydantic import AnyUrl, EmailStr, Field, HttpUrl, StrictBool, ValidationError

from my_typing import *
from utils.validator_utils.pydantic_validator.base import BaseModelV1
from utils.validator_utils.pydantic_validator.parser import parse_model_fields

import utils.enum_utils as enum


class User(BaseModelV1):
    name: StrictBool = Field(..., title="姓名")

def foo():
    ...

try:
    u1 = User(
        name="",
    )
except ValidationError as e:
    model = e.model
    dic = {}
    parse_model_fields(model, dic)
    debug(dic)
    debug(e.errors())
